import request from '@/utils/request'

const  host ='member'
/**
 * 刷新token
 * @param token 
 * @returns 
 */
export const RefreshToken = (token: string): Promise<ResponseData<any>> => request({ url: `accessToken/refreshToken?token=${token}`,  host })

/**
 * 手机号登录
 * @param phone 
 * @param code 
 * @returns 
 */
export const PhoneLogin = (phone: string, code: string): Promise<ResponseData<MemberToken>> => request({ url: `login/phone?phone=${phone}&code=${code}`,  host })

/**
 * 手机授权登录
 * @param code 
 * @returns 
 */
export const PhoneCodeLogin = (code: string): Promise<ResponseData<MemberToken>> => request({ url: `login/phonecode/${code}`,  host })

/**
 * 发送验证码
 * @param phone 
 * @returns 
 */
export const PhoneSendcode = (phone: string): Promise<ResponseData<any>> => request({ url: `login/sendCode?phone=${phone}`,  host })

/**
 * 获取用户信息
 * @returns 
 */
export const Details = (): Promise<ResponseData<Member>> => request({ url: `details`,  host })